package com.example.androiddemo;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

public class SecondTestActivity extends AppCompatActivity implements View.OnClickListener {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.second_activity);

        ((Button)findViewById(R.id.next)).setOnClickListener(this);
        ((Button)findViewById(R.id.back)).setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()){
            case R.id.next:
                Intent intent = new Intent(SecondTestActivity.this,ThreeTestActivity.class);
                startActivity(intent);
                break;
            case R.id.back:
                finish();
        }
    }
}
